Skip to content

fix(feature-flags): constrain direct EVP intake origin - #12299

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 14 commits into
masterfrom
leo.romanovsky/ffe-agentless-evp-java-hardening
Sep 8, 2026
Merged

fix(feature-flags): constrain direct EVP intake origin#12299
gh-worker-dd-mergequeue-cf854d[bot] merged 14 commits into
masterfrom
leo.romanovsky/ffe-agentless-evp-java-hardening

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Motivation

Agentless Feature Flags sends exposures and flag evaluations directly to Event Platform intake when no compatible local EVP route is available. These requests carry DD-API-KEY.

The direct client currently follows redirects, and a crafted DD_SITE value can make the parsed request host differ from event-platform-intake.<DD_SITE>. Either case can send the API key to an unintended origin.

Changes

  • Build the Event Platform URL as HTTPS with HttpUrl.Builder.
  • Require the parsed host to equal event-platform-intake.<DD_SITE>.
  • Disable redirects for direct exposure and flag-evaluation requests.
  • Cover invalid site values and HTTP 301, 302, 307, and 308 responses.

Decisions

  • Reject a direct Event Platform client whose site does not produce the exact expected host.
  • Treat every redirect response as a failed direct request.
  • Do not change /info route selection or local-to-direct fallback classification.

Validation

  • ./gradlew :communication:test --tests datadog.communication.BackendApiFactoryTest
  • ./gradlew :products:feature-flagging:feature-flagging-lib:test --tests com.datadog.featureflag.FeatureFlagBackendApiFactoryTest --tests com.datadog.featureflag.ExposureWriterTests --tests com.datadog.featureflag.FlagEvaluationWriterImplTest
  • ./gradlew :communication:spotlessCheck :communication:forbiddenApisMain :products:feature-flagging:feature-flagging-lib:spotlessCheck :products:feature-flagging:feature-flagging-lib:forbiddenApisMain
  • System-test coverage: DataDog/system-tests#7601

Route direct feature flag intake through standard HTTPS proxy settings and attach the canonical fixed-width API key fingerprint.

Environment: Datadog workspace
@datadog-datadog-us1-prod

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.75 s 14.59 s [+0.1%; +2.1%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.57 s 13.68 s [-1.6%; +0.0%] (no difference)
startup:petclinic:appsec:Agent 17.54 s 17.40 s [-0.0%; +1.6%] (no difference)
startup:petclinic:iast:Agent 17.41 s 17.63 s [-1.9%; -0.5%] (maybe better)
startup:petclinic:profiling:Agent 17.39 s 17.14 s [+0.4%; +2.6%] (maybe worse)
startup:petclinic:sca:Agent 17.58 s 17.45 s [-0.1%; +1.6%] (no difference)
startup:petclinic:tracing:Agent 16.57 s 16.63 s [-1.5%; +0.7%] (no difference)

Commit: aee8de88 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

Keep this PR focused on proxy-aware direct Event Platform intake and leave fingerprinting to an independent change.

Environment: Datadog workspace
Keep the direct-intake diff free of fingerprint-only formatting artifacts.

Environment: Datadog workspace
@leoromanovsky leoromanovsky changed the title Add proxy-aware feature flag intake authentication Add proxy-aware Feature Flags direct intake Aug 26, 2026
Use the original two-argument direct intake factory now that the unrelated fingerprint header plumbing has moved out of this PR.

Environment: Datadog workspace
@linear-code

linear-code Bot commented Aug 26, 2026

Copy link
Copy Markdown

FFL-1482

FFL-1484

@leoromanovsky leoromanovsky changed the title Add proxy-aware Feature Flags direct intake fix(feature-flags): add safe agentless EVP fallback Aug 26, 2026
Reject URL authority confusion before adding DD-API-KEY.

Environment: Datadog workspace
Read standard proxy environment variables without registering them as Datadog configuration aliases, and use the existing non-regex parser for no-proxy hosts.

Environment: Datadog workspace
@leoromanovsky leoromanovsky added tag: ai generated Largely based on code generated by an AI or LLM comp: openfeature OpenFeature type: feature Enhancements and improvements labels Aug 27, 2026
Disable HTTP and HTTPS redirects for Feature Flags direct EVP intake so DD-API-KEY remains bound to the configured origin.

Environment: Datadog workspace
@leoromanovsky
leoromanovsky marked this pull request as ready for review August 27, 2026 16:14
@leoromanovsky
leoromanovsky requested review from a team as code owners August 27, 2026 16:14
@leoromanovsky
leoromanovsky requested review from amarziali, danyal002 and pavlokhrebto and removed request for a team August 27, 2026 16:14

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 489706ce96

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal-api/src/main/java/datadog/trace/api/Config.java Outdated
Comment thread internal-api/src/main/java/datadog/trace/api/Config.java Outdated

@datadog-datadog-us1-prod datadog-datadog-us1-prod Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadog Autotest: FAIL

A plain NO_PROXY domain does not cover its subdomains. This can send direct intake traffic through a proxy that blocks Datadog.

Open Bits AI session

🤖 Datadog Autotest · Commit 75471e9 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Comment thread internal-api/src/main/java/datadog/trace/api/Config.java Outdated
Comment thread metadata/supported-configurations.json Outdated
Comment thread communication/src/main/java/datadog/communication/BackendApiFactory.java Outdated
Comment thread communication/src/main/java/datadog/communication/BackendApiFactory.java Outdated
Keep direct intake origin and redirect protections while removing proxy and runtime failover changes.

Environment: Datadog workspace
@leoromanovsky leoromanovsky changed the title fix(feature-flags): add safe agentless EVP fallback fix(feature-flags): constrain direct EVP intake origin Sep 1, 2026
@mcculls
mcculls requested review from daniel-mohedano and removed request for daniel-mohedano September 3, 2026 18:16
@leoromanovsky
leoromanovsky added this pull request to the merge queue Sep 3, 2026
@dd-octo-sts

dd-octo-sts Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Sep 3, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-03 18:23:42 UTC ℹ️ Start processing command /merge


2026-09-03 18:23:48 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-09-03 18:40:05 UTCMergeQueue: The build pipeline contains failing jobs for this merge request

Build pipeline has failing jobs for 87bf55f:

⚠️ Do NOT retry failed jobs directly (why?).

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.
Details

Since those jobs are not marked as being allowed to fail, the pipeline will most likely fail.
Therefore, and to allow other builds to be processed, this merge request has been rejected and the pipeline got canceled.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 3, 2026
@leoromanovsky
leoromanovsky added this pull request to the merge queue Sep 8, 2026
@dd-octo-sts

dd-octo-sts Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Sep 8, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-08 11:40:35 UTC ℹ️ Start processing command /merge


2026-09-08 11:40:40 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-09-08 12:34:00 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 8, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 3b68bdc into master Sep 8, 2026
810 of 812 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the leo.romanovsky/ffe-agentless-evp-java-hardening branch September 8, 2026 12:33
@github-actions github-actions Bot added this to the 1.67.0 milestone Sep 8, 2026
AlexeyKuznetsov-DD pushed a commit that referenced this pull request Sep 8, 2026
Add proxy-aware feature flag intake authentication

Route direct feature flag intake through standard HTTPS proxy settings and attach the canonical fixed-width API key fingerprint.

Environment: Datadog workspace

Separate direct intake proxying from API key fingerprinting

Keep this PR focused on proxy-aware direct Event Platform intake and leave fingerprinting to an independent change.

Environment: Datadog workspace

Merge live Java master after EVP split

Restore Java formatting after the fingerprint split

Keep the direct-intake diff free of fingerprint-only formatting artifacts.

Environment: Datadog workspace

Update direct-intake tests after fingerprint removal

Use the original two-argument direct intake factory now that the unrelated fingerprint header plumbing has moved out of this PR.

Environment: Datadog workspace

Remove unnecessary Groovy imports

fix(feature-flags): handle ambiguous EVP failures safely

fix(feature-flags): validate direct EVP intake site

Reject URL authority confusion before adding DD-API-KEY.

Environment: Datadog workspace

fix(config): align proxy configuration validation

Read standard proxy environment variables without registering them as Datadog configuration aliases, and use the existing non-regex parser for no-proxy hosts.

Environment: Datadog workspace

fix(feature-flags): reject direct intake redirects

Disable HTTP and HTTPS redirects for Feature Flags direct EVP intake so DD-API-KEY remains bound to the configured origin.

Environment: Datadog workspace

fix(feature-flags): harden proxy configuration

Preserve one-character NO_PROXY entries and prevent HTTPS proxy URLs from exposing credentials through configuration telemetry.

Environment: Datadog workspace

Merge remote-tracking branch 'origin/master' into leo.romanovsky/ffe-agentless-evp-java-hardening

# Conflicts:
#	utils/config-utils/src/main/java/datadog/trace/api/ConfigSetting.java
#	utils/config-utils/src/test/java/datadog/trace/api/ConfigSettingTest.java

refactor(feature-flags): narrow direct intake hardening

Keep direct intake origin and redirect protections while removing proxy and runtime failover changes.

Environment: Datadog workspace

Merge branch 'master' into leo.romanovsky/ffe-agentless-evp-java-hardening\n\nEnvironment: Datadog workspace

Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Sep 8, 2026
fix(feature-flags): constrain direct EVP intake origin (#12299)

Add proxy-aware feature flag intake authentication

Route direct feature flag intake through standard HTTPS proxy settings and attach the canonical fixed-width API key fingerprint.

Environment: Datadog workspace

Separate direct intake proxying from API key fingerprinting

Keep this PR focused on proxy-aware direct Event Platform intake and leave fingerprinting to an independent change.

Environment: Datadog workspace

Merge live Java master after EVP split

Restore Java formatting after the fingerprint split

Keep the direct-intake diff free of fingerprint-only formatting artifacts.

Environment: Datadog workspace

Update direct-intake tests after fingerprint removal

Use the original two-argument direct intake factory now that the unrelated fingerprint header plumbing has moved out of this PR.

Environment: Datadog workspace

Remove unnecessary Groovy imports

fix(feature-flags): handle ambiguous EVP failures safely

fix(feature-flags): validate direct EVP intake site

Reject URL authority confusion before adding DD-API-KEY.

Environment: Datadog workspace

fix(config): align proxy configuration validation

Read standard proxy environment variables without registering them as Datadog configuration aliases, and use the existing non-regex parser for no-proxy hosts.

Environment: Datadog workspace

fix(feature-flags): reject direct intake redirects

Disable HTTP and HTTPS redirects for Feature Flags direct EVP intake so DD-API-KEY remains bound to the configured origin.

Environment: Datadog workspace

fix(feature-flags): harden proxy configuration

Preserve one-character NO_PROXY entries and prevent HTTPS proxy URLs from exposing credentials through configuration telemetry.

Environment: Datadog workspace

Merge remote-tracking branch 'origin/master' into leo.romanovsky/ffe-agentless-evp-java-hardening

# Conflicts:
#	utils/config-utils/src/main/java/datadog/trace/api/ConfigSetting.java
#	utils/config-utils/src/test/java/datadog/trace/api/ConfigSettingTest.java

refactor(feature-flags): narrow direct intake hardening

Keep direct intake origin and redirect protections while removing proxy and runtime failover changes.

Environment: Datadog workspace

Merge branch 'master' into leo.romanovsky/ffe-agentless-evp-java-hardening\n\nEnvironment: Datadog workspace

Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>

Enable Pekko HTTP forked tests

Minor reshuffle.

Remove direct Pekko advice test

Co-authored-by: leoromanovsky <leo.romanovsky@datadoghq.com>
Co-authored-by: alexey.kuznetsov <alexey.kuznetsov@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: openfeature OpenFeature tag: ai generated Largely based on code generated by an AI or LLM type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants